package com.wiscamp.ninechapters.problems.application.assemblers;

import com.wiscamp.ninechapters.problems.application.dto.commands.tasks.CreateAssignmentCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.tasks.CreateAssignmentDetailDto;
import com.wiscamp.ninechapters.problems.application.dto.commands.tasks.UpdateAssignmentCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.tasks.UpdateAssignmentDetailDto;
import com.wiscamp.ninechapters.problems.application.dto.vo.tasks.AssignmentDetailVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.tasks.AssignmentVO;
import com.wiscamp.ninechapters.problems.domain.models.tasks.Assignment;
import com.wiscamp.ninechapters.problems.domain.models.tasks.AssignmentDetail;
import org.mapstruct.Mapper;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface AssignmentAssembler {

    AssignmentAssembler Instance = Mappers.getMapper(AssignmentAssembler.class);

    // region assignment
    AssignmentVO toAssignmentVO(Assignment entity);

    Assignment fromCreateCommand(CreateAssignmentCommand command);

    Assignment fromUpdateCommand(UpdateAssignmentCommand command);
    // endregion

    // region assignment detail
    AssignmentDetailVO toAssignmentDetailVO(AssignmentDetail entity);
    // endregion


    AssignmentDetail toAssignmentDetail(CreateAssignmentDetailDto dto);

    AssignmentDetail toAssignmentDetail(UpdateAssignmentDetailDto dto);
}
